package com.notices.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.notices.mapper.NoticesMapper;
import com.notices.pojo.Notices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticesServiceImpl implements INoticesService {
    @Autowired
    private NoticesMapper mapper;


    @Override
    public List<Notices> list() {
        return mapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Notices getById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public Integer add(Notices notices) {
        return mapper.insert(notices);
    }

    @Override
    public Integer update(Notices notices) {
        return mapper.updateById(notices);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.deleteById(id);
    }

}
